package com.dongwu.manager.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.dongwu.common.dao.BaseDao;
import com.dongwu.manager.entity.Culture;

@Repository
public interface CultureDao extends BaseDao<Culture, String> {

	@Query(value = "select * from culture where id in (SELECT culture_id FROM device_culture where device_id=?1) and title_type=?2 limit ?3,?4", nativeQuery = true) // 原生sql语句
	public List<Culture> findCulture(String device_id, Integer titleType, Integer pageNo, Integer pageSize);
	
	@Query(value = "select * from culture where id in (SELECT culture_id FROM device_culture where device_id=?1) and title_type=?2", nativeQuery = true) // 原生sql语句
	public List<Culture> findCulture(String device_id, Integer titleType);

}
